import React, { useEffect, useRef, useState,forwardRef, useImperativeHandle}  from "react";
import { withRouter } from "react-router-dom";
import './index.scss'
import commonConfig from 'static/js/commonConfig'
import { connect } from 'react-redux'
import {QuerylearningvideosbyID,Approvelearningvideos,setRemark,QuerylearningLevideosbyID,Addormodifylearningvideos,getSubjectInfo,getGraphDetailById} from 'api/index'
import {notification,Image, Button, Modal,Tabs,Tag,Form,Select,Cascader,Spin,Alert, message} from 'antd'
import {checkDraftData} from 'redux/action'
import LlxTable from 'components/LlxTable'
import LlxForm from 'components/LlxForm'
import  VideoUpload  from 'components/Upload/video'
import  UploadSrt  from 'components/Upload/srt'
import  UploadPicture  from 'components/Upload/index'
// 查看更多弹框
import LookMore from 'components/Operations/LookMore'
import LlxHead from "components/Operations/LlxHead";
import http from 'utils/http'
import AfterQuestions from "components/PageCommon/AfterQuestions";
import AddGame from 'components/AddNewGame'
import StudyWord from 'components/PageCommon/StudyWord'
import AddOrEditSubject from "components/AddOrEditSubject";
import PreviewSubject from 'components/LlxPreview/subject'
import EditSubject from 'components/EditSubjec'
import PreviewGame from 'components/LlxPreview/game'
const { TabPane } = Tabs;
const { SHOW_CHILD } = Cascader;
const {getPageJurisdiction,getStatusJurisdiction,statusValue} = commonConfig

// 内容出题
const StudySubject = forwardRef((props, ref) => {
  const {form,disabled} = props
  const [width,setWidth] = useState(null)
  const [height,setHeight] = useState(null)
  const [times,setTimes] = useState(null)
  const [contentItem,setContentItem] = useState({})
  const [addSubejct,setAddSubject] = useState(false)
  const [isModalVisibleEditSubject,setIsModalVisibleEditSubject] = useState(false)
  const [isModalVisibleAddGame,setIsModalVisibleAddGame] = useState(false)
  const [subjectPreviewGame,setSubjectPreviewGame] = useState(false)
  const [subjectPreview,setSubjectPreview] = useState(false)
  const [dataSource,setDataSource] = useState(form.getFieldValue().contentFlows||[])
  const notShowPicture = useRef()
  const canvas = useRef()
  const showVideo = useRef()
  const game = useRef()
  const [subjectFormNew] = Form.useForm()
  const [subjectFormEdit] = Form.useForm()
  const columns = [
    {title: '序号',sorter: true, dataIndex: 'sort', key: 'sort', align: 'center',width:70},
    {title: '时间', dataIndex: 'times', key: 'times', align: 'center',width:100},
    {title: '图片', dataIndex: 'picture', key: 'picture',width:120, align: 'center',render:(text,row)=>{
      return <div>
      {
        row.picture?<Image
        width={60}
        src={row.picture}
      />:<span style={{marginTop:'-20px'}} className='text-link' onPaste={cutUploadPicture}>点击上传截图</span>
      }
    </div>
    }},
    {title: '原尺寸宽', dataIndex: 'sizeWidth', key: 'sizeWidth',width:100, align: 'center'},
    {title: '原尺寸高', dataIndex: 'sizeHeight', key: 'sizeHeight',width:100, align: 'center'},
    {title: '题目类型', dataIndex: 'subjectType', key: 'subjectType',width:120, align: 'center',render:(text)=>{
      return text==='1'?<Tag color="lime">圈图</Tag>:(text==='2'?<Tag color="success">题目</Tag>:<Tag color="blue">未出题</Tag>)
    }},
    {title: '操作', dataIndex: 'action', key: 'action', align: 'center',render:(text, record)=>{
     return <div className="study-btn">
    {
      !record.subjectType?<>
       <Button disabled={disabled || !record.picture} onClick={()=>addSubject('subject',record)} type={'link'} className="text-link">
        创建题目
        </Button>&nbsp;&nbsp;
       <Button disabled={disabled || !record.picture}  onClick={()=>addSubject('graph',record)} type={'link'}  className="text-link">
         创建圈图
       </Button>
       </>:<>
       <Button onClick={()=>previewSubject(record)} type={'link'}  className="text-link">
        预览
       </Button>
       <Button disabled={disabled} onClick={()=>editSubject(record)} type={'link'}  className="text-link">
        编辑
       </Button>
        <Button  onClick={()=>delSubject(record)}  disabled={disabled}  type={'link'} danger className="text-link">
        移除题目
       </Button>
       </>
    }
    
     <Button  onClick={()=>delData(record)}  disabled={disabled}  type={'link'} danger className="text-link">
       移除
     </Button>
     </div> 
    }},
  ]
  useImperativeHandle(ref, () => ({
    dataSource
  }));
   //1. 上传截图
   const cutUploadPicture = (event) => {
        const items = (event.clipboardData || window.clipboardData).items
        let file = null
  
        if (!items || items.length === 0) {
          message.error('当前浏览器不支持本地')
          return
        }
        // 搜索剪切板items
        for (let i = 0; i < items.length; i++) {
          if (items[i].type.indexOf('image') !== -1) {
            file = items[i].getAsFile()
            break
          }
        }
        if (!file) {
          message.error('粘贴内容非图片')
          return
        }
         addFile(file)
   }
   //2.. 上传截图
   const addFile= async (file) => {
        if (file.type.indexOf('image') >= 0) {
          const formData = new FormData()
          formData.append('file', file)
          formData.append('type', 'image')
          const baseUrl = window.location.href.indexOf('/prd')
          const res = await http({
            url: baseUrl === -1 ? 'http://139.224.81.105:19999/qia-cloud-filesystem/fileUpload' : 'http://139.224.81.105:9999/qia-cloud-filesystem/fileUpload',
            method: 'post',
            data: formData
          })
          const data = JSON.parse(JSON.stringify(dataSource))
          data.forEach(i=>{
            if(!i.picture){
              i.picture=res.result
            }
          })
          setDataSource(data)
        }
  }
  // 3.截图或者获取宽高
  const cutPicture = () => {
    if(width){
      setTimes(showVideo.current.currentTime.toFixed(2))
      const canvass = canvas.current
      var ctx = canvass.getContext('2d')
      ctx.drawImage(showVideo.current, 0, 0, canvass.width, canvass.height)
    } else {
      setWidth(notShowPicture.current.clientWidth)
      setHeight(notShowPicture.current.clientHeight)
    }
  }
  // 4.保存新内容
  const addCoorGame = () => {
    setDataSource(value=>[...value,{
      sort:value.length+1,
      times:times,
      subjectType:'',
      picture:'',
      sizeWidth:width,
      sizeHeight:height
    }])
  }
  // 5.预览题目
  const previewSubject = (value) => {
    setContentItem(value)
    if(value.subjectType==='1'){
      setSubjectPreviewGame(true)
      return
    }
    setSubjectPreview(true)
  }
  // 6.创建题目
  const addSubject = (value,data) => {
    subjectFormNew.resetFields() //重置
    setContentItem(data)
    if(value==='subject'){
      setAddSubject(true)
    } else {
      game.current.setDataSource([])
      game.current.form.resetFields()

      game.current.form.setFieldsValue({
        pictureUrl:data.picture,id:'',backgroundMusic:'',
        analysisAudio:'',
        analysisText: '',
        guideAudio: '',
        guideText:''
      })
      setIsModalVisibleAddGame(true)
    }
  }
  // 7.移除题目
  const delSubject = (value) => {
    setDataSource(i=>i.map(x=>{
      if(x.sort===value.sort){
        x.subjectType=''
        x.subjectId=''
      }

      return x
    }))
  }
  // 8.移除此项
  const delData = (value) => {
    setDataSource(i=>i.filter(x=>x.sort!==value.sort))
  }
  // 9.获取最新数据
  const getInfoFn = () => {

  }
  // 10获取答案
  const getSubjectId = (value) =>{
    const data = JSON.parse(JSON.stringify(dataSource))
    data.filter(x=>x.sort===contentItem.sort)[0].subjectType = '2'
    data.filter(x=>x.sort===contentItem.sort)[0].subjectId = value
    setDataSource(data)
  }
  // 10.编辑题目
  const editSubject = async (value) => {

    setContentItem(value)
    if(value.subjectType==='1'){
     const res = await getGraphDetailById(value.subjectId)
     game.current.form.setFieldsValue(res.result)

     game.current.form.setFieldsValue({
       gameItems:res.result.gameCircleDTO?.map((i,j) => {
         return {
           answers: i.answers.map(item => {
             return {
               circleId: item.circleId,
               coordinate: JSON.parse(item.coordinate)
             }
           }),
           pictureUrl: i.pictureUrl,
           examination: i.examination,
           audioUrl: i.audioUrl,
           correctError: i.correctError,
           wordId: i.wordId,
           gameId: i.gameId,
           sort:j+1,
           id: i.id,
           interfereAudio: i.interfereAudio,
           interfereText: i.interfereText
         }
       })||[]
     })

     setIsModalVisibleAddGame(true)
      return
    }

    // 获取题目数据
    const res = await getSubjectInfo(value.subjectId)

    subjectFormEdit.setFieldsValue({
      ...res.result,
      type:[res.result.type+'',res.result.subjectType+''],
      label:res.result.labels?.map(i=>{
        return [i.labelCategoryId,i.id]
      }),
      examinationTypeId:res.result.examinationType?.map(i=>{
        return i.grammarId?i.grammarId:i.examinationTypeId
      })
    })

    setIsModalVisibleEditSubject(true)
  }
    // 11.获取圈图答案
    const getSubjectGameId = (value) => {
      const data = JSON.parse(JSON.stringify(dataSource))
      data.filter(x=>x.sort===contentItem.sort)[0].subjectType = '1'
      data.filter(x=>x.sort===contentItem.sort)[0].subjectId = value
      setDataSource(data)
    }

  return <div className="video-study-content">
    


    <div className="study-set-subject">
      <video
          className="notShowPicture"
          ref={notShowPicture}
          src={form.getFieldValue().videoUrl}
          controls
        />
      <video   className="showPicture" ref={showVideo} src={form.getFieldValue().videoUrl} width={500} controls></video>

      <canvas ref={canvas} width={width} height={height} />
    </div>

    <div className="study-head">
        <Button onClick={addCoorGame} type={'primary'} disabled={times===null||!width||disabled}>保存题目</Button>
        <Button disabled={disabled}  type={'primary'} onClick={cutPicture}>{ width?'点我截图':"获取原视频宽高" }</Button>

        <span>{width?`原视频尺寸:${width} X ${height}`:'请先获取原视频宽高'}</span>
        <span>截图时间:{times}</span>
    </div>

    <div className="study-table">
      {/* 题目区域 */}
      <LlxTable
           selectedRowShow={false}
           height={500}
           paginationHide={true}
           setDataSource={setDataSource}
           columns={columns}
           dataSource={dataSource}/>
    </div>
   {/* 新增题目 */}
  <AddOrEditSubject getSubjectId={getSubjectId} getInfoFn={getInfoFn} sort={dataSource.length+1} globalOriginType={7}   paperBookId={''}  dictionaries={props.dictionaries} form={subjectFormNew}  setIsModalVisible={setAddSubject} isModalVisible={addSubejct}></AddOrEditSubject>
  {/* 编辑题目 */}
  <EditSubject getInfoFn={getInfoFn}  dictionaries={props.dictionaries} form={subjectFormEdit} isModalVisible={isModalVisibleEditSubject}  setIsModalVisible={setIsModalVisibleEditSubject} ></EditSubject>
  {/* 新增圈图 */}
  <AddGame  globalType={7} disabled getSubjectGameId={getSubjectGameId} ref={game} isModalVisible={isModalVisibleAddGame} setIsModalVisible={setIsModalVisibleAddGame} userName={props.userName} dictionaries={props.dictionaries}></AddGame>
  {/* 编辑圈图 */}

  {/* 预览题目 */}
  <PreviewSubject  id={contentItem.subjectId} setIsModalVisible={setSubjectPreview} isModalVisible={subjectPreview} ></PreviewSubject>

  {/* 预览圈图 */}
  <PreviewGame  id={contentItem.subjectId + '?' +Math.random()*100} setIsModalVisible={setSubjectPreviewGame} isModalVisible={subjectPreviewGame} ></PreviewGame>
  </div>
})

// 学习视频详情
const VideoMain = forwardRef((props, ref) => {

  const {form,dictionaries,disabled,userName} = props
  const studyWord = useRef() //单词数据
  const content = useRef() //内容

  // 获取单词信息
  useImperativeHandle(ref, () => ({
    studyWord,content
  }));
  
  // 基本信息表单
  const newItem = [
    {label: '视频名称',type:'input', name: 'videoName' , span: 12 ,rules:[
      {
        required: true,
        message: '请输入视频名称'
      },
    ]},
    {label: '视频简介',type:'input', name: 'remark' , span: 12 },
    {label: '适合年纪', name: 'ageId' , span: 12 ,render: () => {
      return <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择适合年纪'}
      options={dictionaries.AgeRange}
    >
    </Select>
    } },
    {label: '视频类型', name: 'videoCategoryId', span: 12 ,render:()=>{
      return  <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择类型'}
      options={dictionaries.AVType}
    >
    </Select>
    }},
    {label: '配音', name: 'dub', span: 12 ,render:()=>{
      return <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择配音'}
      options={dictionaries.isDub}
    >
    </Select>
    }},
    {label: '字幕内嵌', name: 'captionInId', span: 12 ,render:()=>{
      return <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择幕内嵌'}
      options={dictionaries.CaptionIn}
    >
    </Select>
    }},
    {label: '发行方',type:'input', name: 'publisher', span: 12 },
    {label: '视频系列', name: 'avSerialId', span: 12 ,render:()=>{
      return   <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择系列'}
      options={dictionaries.AvSerial}
    >
    </Select>
    }},
    {label: '主题', name: 'theme', span: 12 ,render:()=>{
      return   <Select
      disabled
      allowClear
      optionFilterProp="dictValue"
      showSearch
      mode="multiple"
      fieldNames={{value:'id',label:'dictValue'}}
      placeholder={'请选择主题'}
      options={dictionaries.Theme}
    >
    </Select>
    }},
    {label: '标签', name: 'label', span: 12 ,render:()=>{
      return  <Cascader  disabled  maxTagCount="responsive" showCheckedStrategy={SHOW_CHILD} fieldNames={{value:'id',label:'labelName'}} options={dictionaries.Label} multiple placeholder="请选择标签" />
    }},
    {label: '视频封面', name: 'pictureUrl', span: 13,render:()=>{
      return  <UploadPicture  disabled pictureUrl={form.getFieldValue().pictureUrl} setPhoto={(value)=>form.setFieldsValue({...form.getFieldValue(),pictureUrl:value})}></UploadPicture>
    }},
    {label: '视频', name: 'videoUrl', span: 14,rules:[
      {
        required: true,
        message: '请上传视频'
      },
    ],render:()=>{
      return  <VideoUpload  disabled  video={form.getFieldValue().videoUrl}></VideoUpload>
    }},
    {label: '上传字幕', name: 'videoSrt' , span: 10,render:()=>{
      return  <UploadSrt  disabled srtUrl={form.getFieldValue().videoSrt} setSrt={(value)=>form.setFieldsValue({...form.getFieldValue(),videoSrt:value})}></UploadSrt>
    }}
  ]
  
  // 获取修改的数据
  return <div  className='info-main'>
    <Tabs defaultActiveKey="1" tabPosition={'left'}>
    <TabPane tab="基本信息" key="1">
     <LlxForm disabled={true} form={form} labelCol={5} formItem={newItem} />
    </TabPane>
    <TabPane tab="单词学习" key="2">
      <StudyWord typeName={'wordList'} ref={studyWord} disabled={disabled} dictionaries={dictionaries} form={form} userName={userName}></StudyWord>
    </TabPane>
    <TabPane tab="内容出题" key="3">
      <StudySubject  ref={content}  form={form} disabled={disabled} userName={props.userName} dictionaries={dictionaries} id={form.getFieldValue().id}  ></StudySubject>
    </TabPane>
    <TabPane tab="课后题" key="4">
      <AfterQuestions disabled={disabled}  type={'LE_VIDEO'} globalType={6} id={form.getFieldValue().id}></AfterQuestions>
    </TabPane>
  </Tabs>



  </div>
})
// 保存数据
const DataDialog  = (props) => {
  const {isModalVisible, setIsModalVisible,form,changeStatus,UserSpecies,userName,disabled,QandPQ} = props
  const value = statusValue(changeStatus,form.getFieldValue().videoStatus) //修改的状态

  const loading = useRef(false)

  const manager = value==='Q'||value==='PQ'?QandPQ:UserSpecies

  const [formItem] = Form.useForm();//学习视频详情

  const item = ['N','PN','P'].includes(value)?[
    {label: '备注内容',type:'textArea', name: 'remark' , span: 24 }
  ]:[
    {label: '负责人', name: 'manager' , span: 24 ,rules:[
      {
        required: true,
        message: '请选择负责人'
      },
    ],render:()=>{
      return  <Select

      allowClear
      optionFilterProp="dictValue"
      showSearch
      fieldNames={{value:'userName',label:'userName'}}
      placeholder={'请选择负责人'}
      options={manager}
    >
    </Select>
    }},
    {label: '备注内容',type:'textArea', name: 'remark' , span: 24 }
  ]
  
 const handleCancel = () => {
    setIsModalVisible(false);
 };
 
 const handleOk = () => {
   if(loading.current) {
    message.error('请勿多次点击')
   }

  loading.current=true
  formItem.validateFields().then(async()=>{
  //  1更改状态
  await Approvelearningvideos({
    id: form.getFieldValue().id,
    videoStatus: value,
    qmanager: value==='Q'||value==='PQ'?formItem.getFieldValue().manager:'',
    rmanager: value==='R'||value==='PR'?formItem.getFieldValue().manager:'',
  })
   
  // 留言
  await setRemark({
    manager: formItem.getFieldValue().manager||'',
    dataId: form.getFieldValue().id,
    type: 'LE_VIDEO',
    remark: formItem.getFieldValue().remark,
    statusNow: form.getFieldValue().videoStatus,
    statusNext: value
  })
  console.log(props.main.current,disabled);
  //  2修改数据
   if(!disabled){
       const editValue = {
        id: form.getFieldValue().id,
        videoWords: props.main.current.studyWord.current?.dataSource.map((i, index) => {
          return {
            'id': i.id,
            'picture': i.picture,
            'sort': index + 1,
            'wordId': i.wordId
          }
        })||form.getFieldValue().bookWordFlows,
        videoContentFlows: props.main.current.content.current?.dataSource.map((i, index) => {
          return {
            id: i.id || '',
            'picture': i.picture,
            'sizeHeight': i.sizeHeight,
            'sizeWidth': i.sizeWidth,
            'sort': index + 1,
            'subjectType': i.subjectType,
            'subjectId': i.subjectId,
            'times': i.times
          }
        })||form.getFieldValue().contentFlows
       }
        await Addormodifylearningvideos(editValue)
        notification.success({
          message: '保存成功',
          description: '操作人：' + userName,
          duration:1.5
        });
      
        props.getVideoInfoFn()
        formItem.resetFields()
        setIsModalVisible(false);
   } else {
    props.getVideoInfoFn()
    formItem.resetFields()
    setIsModalVisible(false);
   }
  })
  loading.current=false
 }

return   <>
<Modal onOk={handleOk}  width={600} title="保存数据" visible={isModalVisible}  onCancel={handleCancel}>
      <Alert className="edit-alert" message={'你确定要修改状态至' + value + '吗？'} type="success" />

     <LlxForm form={formItem} labelCol={3} formItem={item} />
 </Modal>
</>
}


function VideoStudyInfo(props) {

  const {examineStatus} = props
  const [isModalVisibleMore,setIsModalVisibleMore] = useState(false)
  const [isModalVisibleData,setIsModalVisibleData] = useState(false)
  const [disabled,setDisabled] = useState(false)
  const [loading,setLoading] = useState(true)
  const id = commonConfig.getUrlParams(props).id
  const [form] = Form.useForm();//学习视频详情
  const head = useRef()
  const main = useRef() //单词数据

  const [preservationJurisdiction,setPreservationJurisdiction] = useState({})
  // 1.获取数据
  useEffect(()=>{
    getVideoInfoFn()
  }, [examineStatus])// eslint-disable-line react-hooks/exhaustive-deps


  // 2.查看更多
  const getMore = () => {
    setIsModalVisibleMore(true)
  }
  // 3.保存数据
  const preservationData = () => {
   const value = statusValue(head.current.current,form.getFieldValue().videoStatus)
   if(!getStatusJurisdiction(preservationJurisdiction[0],preservationJurisdiction[1],preservationJurisdiction[2],preservationJurisdiction[3],preservationJurisdiction[4],preservationJurisdiction[5]).includes(value)) {
    notification.error({
      message: '该数据你无法保存，请联系管理员',
      description: '操作人：' + props.userInfo.user.userName,
      duration:2
    });
    return
   }
  
  // 打开弹框 输入备注 修改状态 修改数据
  setIsModalVisibleData(true)
  }
  // 4.更新数据
  const getVideoInfoFn = async () => {
    if(examineStatus){
      const res = await QuerylearningvideosbyID(id)
      if(!res.result.id){
        notification.error({
          message: '该学习视频未发布过',
          duration:1.5
        });
        props.checkDraftDataBtn()
        setLoading(false)
        return
      }
      form.setFieldsValue(res.result)
      form.setFieldsValue({
        wordList:res.result.bookWords,
        label:res.result.labels?.map(i=>{
          return [i.labelCategoryId,i.id]
          }),
        theme:res.result.themes?.map(i=>i.id)
      })
      setDisabled(true)
  
      setLoading(false)
    } else {
      const res = await QuerylearningLevideosbyID(id)
      form.setFieldsValue(res.result)
      form.setFieldsValue({
        wordList:res.result.bookWordFlows,
        label:res.result.labels?.map(i=>{
          return [i.labelCategoryId,i.id]
          }),
        theme:res.result.themes?.map(i=>i.id)
      })
      setDisabled(!getPageJurisdiction(res.result.videoStatus,res.result.createBy,props.userInfo.user.userName))

      setPreservationJurisdiction([res.result.videoStatus,res.result.createBy,res.result.rmanager,res.result.qmanager,props.userInfo.user.userName,props.userInfo.roles.map(i => i.id).includes(7)])
     
      setLoading(false)
    }
  }

  return <div className="app-content-info animate__animated animate__fadeIn">
  {
    !loading?(
      <>
      <LlxHead nameType={'videoName'} statusType={'videoStatus'} examineStatus={examineStatus}  ref={head} preservationJurisdiction={preservationJurisdiction}  preservationData={preservationData} userName={props.userInfo.user.userName} role={props.userInfo.roles.map(i => i.id).includes(7)} form={form} getMore={getMore}></LlxHead>
       
       {/* 查看更多信息 */}
       <LookMore  type={'LE_VIDEO'} preservationJurisdiction={preservationJurisdiction}  isModalVisible={isModalVisibleMore}  setIsModalVisible={setIsModalVisibleMore} ></LookMore>
       {/* 保存数据 */}
       <DataDialog main={main} getVideoInfoFn={getVideoInfoFn}  disabled={disabled} form={form} QandPQ={props.dictionaries.QandPQ} UserSpecies={props.dictionaries.UserSpecies} userName={props.userInfo.user.userName} status={form} changeStatus={head.current?.current}   id={id} isModalVisible={isModalVisibleData} setIsModalVisible={setIsModalVisibleData} ></DataDialog>
       
       {/* 主要内容区域 */}
       {/* 1.草稿可编辑 */}
       <VideoMain  disabled={disabled} ref={main} form={form} userName={props.userInfo.user.userName} dictionaries={props.dictionaries}></VideoMain>
      </>
    ):<Spin className="info-loading" tip="Loading..."></Spin>
  }
  </div>
}

// 映射方法
const mapDispatchToProps = (dispatch) => {
  return {
    checkDraftDataBtn: () => dispatch(checkDraftData())
  }
}

export default connect((state)=>{
  return {examineStatus:state.examineStatus,userInfo:state.userInfo,dictionaries:state.dictionaries}
},mapDispatchToProps)(withRouter(VideoStudyInfo))